package ltd.latewhale.whalenest.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import ltd.latewhale.whalenest.DTO.commentsDTO;
import ltd.latewhale.whalenest.model.ProjectInformationDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ProjectInformationMapper extends BaseMapper<ProjectInformationDO> {

    @Select("SELECT id,ccontent,ctitle FROM comments WHERE pid = #{id};")
    List<commentsDTO> commentsData(Integer id);

    @Select("UPDATE projectinformation SET psupport = psupport + 1 WHERE id = #{id};")
    void psupportAdd(Integer id);
}
